"""
输入: 5
输出:
[
     [1],
    [1,1],
   [1,2,1],
  [1,3,3,1],
 [1,4,6,4,1]
]

"""
from typing import List


class Solution:
    def generate(self, numRows: int) -> List[List[int]]:
        ans = []
        if numRows == 0:
            return []
        def helper(res, n):
            ans.append(res)
            if n == numRows+1:
                return

            s = []
            for i in range(n):
                a = res[i-1] if i > 0 else 0
                b = res[i] if i < n - 1 else 0
                print(i,n)
                s.append(a + b)

            helper(s, n + 1)
            # return 

        helper([1], 2)
        return ans

if __name__ == "__main__":
    print(Solution().generate(0))

